package nu.boomboom.smartfsync.impl;

import java.io.File;

import nu.boomboom.smartfsync.IDifferences;
import nu.boomboom.smartfsync.IDir;
import nu.boomboom.smartfsync.IElement;
import nu.boomboom.smartfsync.IFileSystem;

public class FileSystem implements IFileSystem {

	private final String name;
	private final File baseDir;

	public FileSystem(File baseDir, String name) {
		this.name = name;
		this.baseDir = baseDir;
	}

	@Override
	public String name() {
		return name;
	}

	@Override
	public IDifferences differencesFrom(IFileSystem dir) {
		// TODO Auto-generated method stub
		return null;
	}

	static IElement toElement(File file) {
		if (file == null)
			return null;
		return file.isDirectory() ? new DirImpl(file) : new FileImpl(file);
	}

	@Override
	public IDir dir() {
		return new DirImpl(baseDir);
	}

}
